<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .square1 {
            width: 30%;
            background: red;
            overflow: hidden;
        }

        .square1-after {
            margin-top: 100%;
        }
    </style>
</head>

<body>
    <div class="square1">
        <div class="square1-after"></div>
    </div>
</body>
</html>